The following relates generally to wireless communication, and more specifically to wireless communication devices that employ wake locks for applications running thereon. Wireless communications systems are widely deployed to provide various types of communication content such as voice, video, packet data, messaging, broadcast, and so on. These systems may be multiple-access systems capable of supporting communication with multiple users by sharing the available system resources (e.g., time, frequency, and power). Examples of such multiple-access systems include code-division multiple access (CDMA) systems, time-division multiple access (TDMA) systems, frequency-division multiple access (FDMA) systems, and orthogonal frequency-division multiple access (OFDMA) systems.
Generally, a wireless multiple-access communications system may include a number of base stations, each simultaneously supporting communication for multiple mobile devices. Base stations may communicate with mobile devices on downstream and upstream links. In general, it is desirable to reduce or minimize power consumption by a mobile device because such devices typically have limited power availability provided by rechargeable batteries. As such, it is known to have a mobile device enter a lower power state (e.g., a sleep mode or state) when the device is not active, for example, communicating with a base station.
However, an important part of an operating system application program interface (API) is a wake lock. A wake lock provides a mechanism for the application developer to indicate that their application needs the device to stay on (e.g., remain in a higher power state, for example, by not entering a sleep mode). Wake locks may be configured with a variety of states that affect the device's central processing unit (CPU), screen, and/or keyboard behavior. The wake locks referenced here are user space wake locks, controlled via the operating system API. Kernel space wake locks are classified differently and limit the CPU's ability to idle or suspend.
Wake locks, however, may affect the battery life of a mobile device. For example, once a user grants an application permission to create wake locks for a device, the application may create a wake lock, which may prevent the CPU from entering the suspend (or sleep) state and may even override the user's indication that they would like to suspend the CPU. Improper wake lock management can take two forms: (1) unnecessarily creating a wake lock; and (2) holding a wake lock longer than necessary.
The second form of improper wake lock management extends, in the most extreme case, to an application not releasing a wake lock at all, and therefore holding the wake lock until the operating system of the device stops the application.